import axios from 'axios';

const PORT = 3000;
const baseURL = `http://localhost:${PORT}`;
const service = axios.create({
    baseURL,
    timeout: 5000,
})

service.interceptors.request.use(config => {
    // 添加token
    return config;
},err => Promise.reject(err));

service.interceptors.response.use(res => {
    return res.data;
},err => {
    // 状态码判断
    return Promise.reject(err);
})

export default service;